package demo1;

import UDPdemo.UDPechoServer;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Hashtable;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-10-20
 * Time: 22:29
 */
public class zidianservse extends UDPechoServer {
    private HashMap<String, String> hashMap = new HashMap<>();
    public zidianservse(int port) throws SocketException {
        super(port);
        hashMap.put("cat","猫");
        hashMap.put("dog", "狗");
        hashMap.put("food", "食物");
    }

    @Override
    public String press(String req) {
        return hashMap.getOrDefault(req, "无");
    }

    public static void main(String[] args) throws IOException {
        zidianservse servse = new zidianservse(9090);
        servse.start();
    }
}
